//
//  XTStrategyAlbumCollectionViewCell.m
//  BeautifulHome
//
//  Created by dlios on 15-5-15.
//  Copyright (c) 2015年 ACE. All rights reserved.
//

#import "XTStrategyAlbumCollectionViewCell.h"
#import "UIImageView+WebCache.h"

@interface XTStrategyAlbumCollectionViewCell ()
@property (nonatomic, retain) UIImageView *myImageView;

@end
@implementation XTStrategyAlbumCollectionViewCell
- (void)dealloc
{
    [_pictureName release];
    [super dealloc];
}
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.myImageView = [[UIImageView alloc] init];
        self.myImageView.contentMode = UIViewContentModeScaleAspectFit;
        [self.contentView addSubview:self.myImageView];
        [UIImageView release];
        
    }
    return self;
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    [super applyLayoutAttributes:layoutAttributes];
    self.myImageView.frame = CGRectMake(0, 0, self.contentView.frame.size.width, self.contentView.frame.size.height);
}

- (void)setPictureName:(NSString *)pictureName
{
    if (_pictureName != pictureName ) {
        [_pictureName release];
        _pictureName = [pictureName retain];
    }
    [_myImageView sd_setImageWithURL:[NSURL URLWithString:_pictureName]];
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
